<?php
require_once('../connection.php');

$sql = 'SELECT * FROM user WHERE email=?';
$sth = $db->prepare($sql);
$sth->execute (array ($_POST['epost']));
if ($row = $sth->fetch()) {
	echo json_encode (array ('email_in_use'=>'E-posten er allerede i bruk!'));
} else
	echo json_encode (array ('ok'=>'OK'));  
?>
